package com.example.mystoryapp2.data.network.service

import com.example.mystoryapp2.domain.Page
import com.example.mystoryapp2.domain.RecordStatic
import com.example.mystoryapp2.domain.Records
import com.example.mystoryapp2.domain.Story
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.POST

interface PageService {

    @POST("page/getListByParentId")
    fun getListByOId(@Body id: Int): Call<List<Page>>

    @POST("page/getFirst")
    fun getFirst(@Body storyId: Int): Call<Page>

    @POST("page/add")
    fun add(@Body page: Page): Call<Int>

    @POST("page/delete")
    fun delete(@Body id: Int): Call<Boolean>

    @POST("page/update")
    fun update(@Body page: Page): Call<Boolean>

    @POST("page/getById")
    fun getById(@Body id: Int): Call<Page>

    @POST("page/getParentId")
    fun getParentId(@Body id: Int): Call<Int>

    @POST("records/addRecords")
    fun addRecords(@Body record: Records): Call<Boolean>

    @POST("records/getReadStatic")
    fun getReadStatic(@Body story: Int): Call<List<RecordStatic>>

    @POST("records/loadLastReadPage")
    fun loadLastReadPage(@Body userId: Story): Call<Int>

}